package com.Maykk.Demo01;

/**
 * @ClassName: Demo01
 * @Description: TODO 泛型类练习
 * @Author: MaykkStar@163.com
 */
public class Demo01 {
    public static void main(String[] args) {
        Generic<String> strG = new Generic<>();
        strG.setT("我是一个字符串");
        System.out.println(strG.getT());
        Generic<Integer> intG = new Generic<>();
        intG.setT(100);
        System.out.println(intG.getT());

        // 也可以传一个普通类进去
        Generic<Student> stuG = new Generic<>();
        stuG.setT(new Student("小肆", 20));
        System.out.println(stuG.getT());
    }
}
